package com.tongtech.system.service.impl;

import com.tongtech.common.datascope.annotation.DataScope;
import com.tongtech.system.domain.InformationPushLog;
import com.tongtech.system.mapper.InformationPushLogMapper;
import com.tongtech.system.service.IInformationPushLogService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 资讯推送日志 服务实现
 *
 * @author xingyc
 */
@Service
public class InformationPushLogServiceImpl implements IInformationPushLogService
{

    private static final Logger log = LoggerFactory.getLogger(InformationPushLogServiceImpl.class);

    @Autowired
    private InformationPushLogMapper pushLogMapper;

    /**
     * 查询资讯推送日志数据
     *
     * @param pushLog 资讯信息
     * @return 资讯信息集合
     */
    @Override
    @DataScope(deptAlias = "pushLog")
    public List<InformationPushLog> selectInformationPushLogList(InformationPushLog pushLog)
    {
        return pushLogMapper.selectInformationPushLogList(pushLog);
    }

    /**
     * 根据资讯ID查询信息
     *
     * @param pushLog 资讯ID
     * @return 资讯信息
     */
    @Override
    public InformationPushLog selectInformationPushLogById(Long pushLog)
    {
        InformationPushLog dbInformationPushLog = pushLogMapper.selectInformationPushLogById(pushLog);
        return dbInformationPushLog;
    }

    /**
     * 新增保存资讯信息
     *
     * @param pushLog 资讯信息
     * @return 结果
     */
    @Override
    public int insertInformationPushLog(InformationPushLog pushLog)
    {
        int result = pushLogMapper.insertInformationPushLog(pushLog);
        return result;
    }

}
